home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / mtgrap1c / demo4.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-13  |  1.9 KB  |  80 lines

  1. /*                                                            
  2.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  3.   ▒                                                          ▒
  4.   ▒                                                          ▒
  5.   ▒             Neuromancer's Graphics Library               ▒
  6.   ▒                     Version 1.0c                         ▒
  7.   ▒                                                          ▒
  8.   ▒  This routine demonstrate circle and filled circle in    ▒
  9.   ▒  a clipped region                                        ▒
  10.   ▒                                                          ▒ 
  11.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  12.   ▒                                                          ▒
  13.   ▒     Project:    MTLIB01.LIB                              ▒
  14.   ▒                 DEMO4.CPP                                ▒
  15.   ▒                                                          ▒ 
  16.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  17. */
  18.  
  19. #include <iostream.h>
  20. #include <stdlib.h>
  21. #include <conio.h>
  22. #include "video.h"
  23. #include "circle.h"
  24.  
  25. void main(void)
  26. {
  27.     int x,y,radius,color;
  28.  
  29.     mtSetVGAMode();            //Set up VGA Mode
  30.  
  31.     while(!kbhit())
  32.     {
  33.         x = random(320);
  34.         y = random(200);
  35.         radius = random(50);
  36.         color = random(256);
  37.  
  38.         if ((radius < x ) || (radius < y))
  39.         {
  40.         mtCCircle(x,y,radius,color);
  41.         }
  42.     }
  43.  
  44.     getch();
  45.  
  46.     mtClrScr(0);
  47.  
  48.     mtSetWindow(15,15,304,184);    //set up clip region
  49.     mtClrScr(15);            //clear region to color 15
  50.  
  51.     while(!kbhit())
  52.     {
  53.         x = random(320)+1;
  54.         y = random(200)+1;
  55.         radius = random(40);
  56.         color = random(256);
  57.  
  58.         if ((radius < x ) || (radius < y))
  59.         {
  60.         mtCFillCircle(x,y,radius,color);
  61.         }
  62.      }
  63.  
  64.      getch();
  65.  
  66.     mtSetTextMode();
  67.  
  68.     cout << "Thank you for using the library!" << endl;
  69.  
  70.     exit(0);
  71.     
  72. }
  73.  
  74.            
  75.             
  76.  
  77.            
  78.  
  79.            
  80.